package com.ellricky.baselib.adapter.course

import android.app.Activity
import android.widget.ImageView
import com.andr.common.ui.adapter.BaseRecyclerAdapter
import com.andr.common.ui.adapter.SmartViewHolder
import com.ellricky.baselib.R
import com.ellricky.baselib.entity.new.PrepareImg
import com.ellricky.baselib.util.GlideUtil

class PrepareCourseAdapter :
    BaseRecyclerAdapter<PrepareImg>(R.layout.base_adapter_prepare_course) {

    override fun onBindViewHolder(vh: SmartViewHolder, data: PrepareImg, p2: Int) {
        val ivCover = vh.itemView.findViewById<ImageView>(R.id.iv_cover)
        GlideUtil.into(vh.itemView.context as Activity, data.img, ivCover)
        vh.text(R.id.tv_file, "上传文件${p2 + 1}")
            .text(R.id.tv_create_time, "上传时间:${data.time}")
    }
}